<template>
    <!-- 全局背景组件 -->
    <div  class="global-box"   :style="`backgroundColor:${$store.state.globalMask.bgColor};z-index:${$store.state.globalMask.zIndex}`" @click="clickGlobalMask">

    </div>
</template>

<script>
  export default{
    data(){
      return{
      }
    },
    created() {
      //console.log(this.$store.state.isGlobalMaskClick)
    },
    computed:{
    },
    wacth:{
    },
    methods:{
       clickGlobalMask(){
         if (!this.$store.state.isGlobalMaskClick) return
          this.$emit('formChildMsg', {//关闭所有弹出层
            // type: 'closeAllPopup',
            // data: ''
             type: "closeAllPopup",
            data: "",
            origin: this.$store.state.globalMask.origin, //丁一20211231在store.state.globalMask对象,增加origin字段,用来区分mask来源(从顶部搜索栏||从活动入口icon),避免点击遮罩,点击顶部searchBar后,传递参数origin=fromSearchBar
          })
       },
    }
  }
</script>

<style scoped="scoped">
  .global-box{
    width: 100vw;
    height: 100vh;
    background: transparent;
    position: absolute;
    position: fixed;
    /* position: absolute; */
    top: 0;
    left:0;
    z-index: 1500;
  }
</style>
